//
package main

import "fmt"

func main(){


	var age int32
	fmt.Println("请输入年龄")
	fmt.Scanln(&age)

	if age > 18 {
		fmt.Println("恭喜你")
	}else{
		fmt.Println("不恭喜你")
	}

	if name := "toms"; name!= "tom"{
		fmt.Println("你不是 tom")
	}

	var n1 int32 = 19
	var n2 int32 = 223
	if n1 + n2 > age && n1 < n2{
		fmt.Println("enter")
	}


	//匹配项后不需要带break
	switch age {
	case 12,232,22:
		fmt.Println("s")
	case 23:
		fmt.Println("2")
	default:
		fmt.Println("d")
	}

	//switch 别类用法 后面可以不带表达式    switch case 会默认带上break 如果需要穿透到下一层  协商fallthrough
	switch{
	case 12<23:
		fmt.Println("12<23")
		fallthrough
	case 12<23:
		fmt.Println("12<23")
	case age == 1:
		fmt.Println("age == 1")
	}


	//带表达式   
	switch address := "日喀则";{
	case address == "1":
		fmt.Println("1")
	case address == "日喀则":
		fmt.Println("gegeyu")
	case address =="lasa":
		fmt.Println("lasa")
	}

	//Type-switch

	

}